<div class="layuimini-container">
    <div class="layuimini-main">
        <div>
            <button class="layui-btn layui-btn-normal layui-btn-sm" onclick="exportRecord()">导出记录</button>
        </div>
        <table id="currentTable" class="layui-table layui-hide"
               data-auth-add="{:auth('statistics.online_record/add')}"
               data-auth-edit="{:auth('statistics.online_record/edit')}"
               data-auth-delete="{:auth('statistics.online_record/delete')}"
               lay-filter="currentTable">
        </table>
    </div>
</div>
<script>
     function exportRecord ()
        {
            let rid = $("#c-rid").val()
            let username = $("#c-username").val()
            let extension = $("#c-extension").val()
            let group = $("#c-group").val()
            let start_time = $("#c-start_time").val()
            let end_time = $("#c-end_time").val()
            let duration = $("#c-duration").val()
            let filter = {};
            let op = {};


            if (rid != "") {
                filter.rid = rid
                op.rid = "%*%"
            }

            if (username != "") {
                filter.username = username
                op.username = "%*%"
            }

            if (extension != "") {
                filter.extension = extension
                op.extension = "%*%"
            }

            if (group != "") {
                filter.group = group
                op.group = "="
            }

            if (start_time != "") {
                filter.start_time = start_time
                op.start_time = "range"
            }

            if (end_time != "") {
                filter.end_time = end_time
                op.end_time = "range"
            }
            if (duration != "") {
                filter.duration = duration
                op.duration = "="
            }
            window.location.href = "execlxls?filter="+JSON.stringify(filter)+"&op=" + JSON.stringify(op)
            // $.ajax({
            //     type: "GET",
            //     url: "execlxls",
            //     data:{filter:JSON.stringify(filter),op:JSON.stringify(op)},
            //     success: function (res) {
                        
            //     }

            // })

        } 

</script>